home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / print / p1123mz4.zip / X1123X3D.H < prev   
C/C++ Source or Header  |  1994-02-15  |  2KB  |  67 lines

  1. #ifndef X1123X3D_H
  2. #define X1123X3D_H
  3.  
  4. //      Objects instantiated from this class may be used to plot z=f(x,y) in
  5. // in three dimensions on a Panasonic 1123 printer.
  6.  
  7. //      This class uses the abstract class "plot3d" (3D plot) which in turn uses 
  8. // the template "varray" (one dimensional virtual array) and the class
  9. // "titillat" (to let the user know the code is running).  This class also uses
  10. // "varray".
  11.  
  12. #include "varray.h"
  13. #include "plot3d.h"
  14.  
  15. typedef char * char_ptr;
  16.  
  17. // graphics constants 
  18. #define PIXELS_PER_INCH       180
  19. #define LINE_PREFIX_2          39    // for 180 dpi in 24-pin mode 
  20. #define WIDTH_IN_INCHES         8.0
  21. #define LENGTH_IN_INCHES       11.0
  22. #define NUM_LINES              82
  23. #define NUM_X_PIXELS         1968    // 24*NUM_LINES 
  24. #define X_DOT_MAX            1967    // NUM_X_PIXELS-1 
  25. #define NUM_Y_PIXELS         1440
  26. #define NUM_Y_PIXELS_MOD_256  160
  27. #define NUM_Y_PIXELS_DIV_256    5
  28. #define Y_DOT_MAX            1439    // NUM_Y_PIXELS-1 
  29. #define ASPECT_RATIO            1.0  // (WIDTH_IN_INCHES/((float) NUM_Y_PIXELS))
  30.                                    // /(LENGTH_IN_INCHES/((float) NUM_X_PIXELS)) 
  31.  
  32. typedef struct
  33.           {
  34.             unsigned char column [NUM_Y_PIXELS] [3];
  35.           } row_rec;  // 3 lines of graphics to be sent to the printer
  36.  
  37. class x1123x3d : public plot3d
  38.   {
  39.     private:
  40.       varray<row_rec>   *row_array;         
  41.                          // page of graphics to be sent to the printer
  42.       int               row_array_allocated;
  43.                          // TRUE if and only if "row_array" allocated
  44.     public:
  45.       double aspect_ratio(void) {return ASPECT_RATIO;}
  46.  
  47.       int    display_initialized(void);
  48. //      Allocate and clear the page of graphics to be sent to the printer.
  49.  
  50.       int    num_x_pixels(void) {return NUM_X_PIXELS;}
  51.  
  52.       int    num_y_pixels(void) {return NUM_Y_PIXELS;}
  53.  
  54.       void   pset(int x,int y,int color_num);
  55. //      Use dithering to set the pixel at (x,y).
  56.  
  57.       int    write_outfile(char *file_name);
  58. //      Write the page of graphics to a file where it can later be copied
  59. // to the printer.  (The /B option *must* be used with the COPY command.)
  60.  
  61.              x1123x3d(void);
  62.  
  63.              ~x1123x3d(void);
  64.   };
  65.  
  66. #endif
  67.